package search;

/**
 * Created by Olga on 21.05.2014.
 */
public class BubbleSort {
    public int[] bubble(int[] src) {
        int[] arr = src.clone();
        for (int i = 0; i < arr.length - 1; i++) {
            for (int j = i + 1; j < arr.length; j++) {
                if (arr[i] > arr[j]) {
                    int tmp = arr[i];
                    arr[i] = arr[j];
                    arr[j] = tmp;
                }
            }
        }

        return arr;
    }
}
